package com.example.traning.mall.framework.security.config;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.time.Duration;
import java.util.Collections;
import java.util.List;

/**
 * @author lei yu
 * @since 2024/10/14
 */
@ConfigurationProperties(prefix = "tmall.security")
@Data
public class MallSecurityProperties {

    /**
     * JWT的有效时长
     */
    @NotNull(message = "duration 不能为空")
    private Duration duration;
    /**
     * JWT的secretKey
     */
    @NotEmpty(message = "secretKey 不能为空")
    private String secretKey;
    /**
     * 免登录的 URL 列表
     */
    private List<String> permitAllUrls = Collections.emptyList();
}
